package com.the_last.pojo.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @TableName order
 */
@TableName(value = "`order`")
@Data
public class Order {
    
    public static final String STATUS_NOT_PAID = "待付款";
    public static final String STATUS_DELIVERY = "配送中";
    public static final String STATUS_FINISHED = "已完成";
    public static final String STATUS_CANCELED = "取消订单"; // 前置条件为未支付
    public static final String STATUS_REFUND = "退款中"; // 前置条件为已支付
    public static final String STATUS_REFUND_SUCCESS = "退款成功"; // 前置条件为退款中
    public static final String STATUS_TIMEOUT_CLOSED = "超时关闭"; // 前置条件为未支付
    
    // 全部 待付款 配送中 已完成 售后
    
    /**
     * 订单ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    
    /**
     * 用户ID
     */
    private Long userId;
    
    /**
     * 配送员ID（员工ID）
     */
    private Integer deliverymanId;
    
    /**
     * 提交时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date submitTime;
    
    /**
     * 支付时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date paymentTime;
    
    /**
     * 完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date completeTime;
    
    /**
     * 订单状态
     */
    private String status;
    
    /**
     * 总金额
     */
    private BigDecimal totalAmount;
    
    private Integer deleted;
}